package com.easy;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Lxk on 2019/6/8.
 */
public class Solution590 {



    private void postVisit(Node root,List<Integer> res){
        if(root==null){
            return ;
        }
        for(Node node : root.children){
            postVisit(node,res);
        }
        res.add(root.val);
    }



    public List<Integer> postorder(Node root) {
        List<Integer> res = new ArrayList<>();
        postVisit(root,res);
        return res;
    }

}
